UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'msjjzSY3P0dD96VTZmPy7yvTCcCzL8UMU33L+Uy9DNw='
WHERE
key_id = '39bc2511df5a463dace6b4f6a7a3d1f4ed8ce893b69bcaa2e59b2ef7ba4c089e'
AND (
token = 'msjjzSY3P0dD96VTZmPy7yvTCcCzL8UMU33L+Uy9DNw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)