UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZUm+OP0uAVe/LIuufauKndAJApvezC8JnJRn+uobj3I='
WHERE
key_id = 'd93d58feeacb862ec10cffd72f612664583aabf5ade060e32790334ef156231b'
AND (
token = 'ZUm+OP0uAVe/LIuufauKndAJApvezC8JnJRn+uobj3I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)