UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'B0+kG+qJdPthfyJa/6hTsW2rRiFNXZvbdsI5bVmLIHU='
WHERE
key_id = 'a44f7dedfc7f6ff464a3e3dedf45118b61e1fc61c6c9a0948998fc0c92be2674'
AND (
token = 'B0+kG+qJdPthfyJa/6hTsW2rRiFNXZvbdsI5bVmLIHU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)