UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'eGX5bBa+C25sxYRcVRekSjYQYGbni+sqXhjW3NqQ/LA='
WHERE
key_id = '7f451df9f79e6e379c84b6f722041c6351c0059576ccecc1d16fb2e299415163'
AND (
token = 'eGX5bBa+C25sxYRcVRekSjYQYGbni+sqXhjW3NqQ/LA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)