UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Oq1YcYRF9j3GsdEasLjOUgBAI5kTmlgzHcQDoV6/pTI='
WHERE
key_id = '306592407b639fef8c0de82b9bab7d46d8fc9c78fd6c2f9db6f21943f6b8c34a'
AND (
token = 'Oq1YcYRF9j3GsdEasLjOUgBAI5kTmlgzHcQDoV6/pTI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)