UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HRU6lvO8Jzw8tRNElKE4VIiB0VuBvnqOK+3fpVmq6DQ='
WHERE
key_id = '5ee7b5cc78bd90c4223e2b06c0987d94bd7a4761029cf23596354da65fe8295d'
AND (
token = 'HRU6lvO8Jzw8tRNElKE4VIiB0VuBvnqOK+3fpVmq6DQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)