UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'V4NpseMUoYU7iBJWRa4t9wXcy47LWK7JzYpXwpbzofQ='
WHERE
key_id = '1e49ef9ea77e555e0a0015e99fccd5c0ffa77359f03f6ea5d1e57f1e924e0dd8'
AND (
token = 'V4NpseMUoYU7iBJWRa4t9wXcy47LWK7JzYpXwpbzofQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)