UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yAixHZWEJZckSuYG+1xpvwbC99ZDB7nXshkoT9SSV0U='
WHERE
key_id = 'dc420906fffe8a88914fcf4f49169568b2b4ea541fb00a4073224d286f0b0565'
AND (
token = 'yAixHZWEJZckSuYG+1xpvwbC99ZDB7nXshkoT9SSV0U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)