UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'E0vEbec0BZDqq9btt2KD8cp0lKezYsWoxWv3f1VhzIc='
WHERE
key_id = '300cce79746266f67f19dc5f9b78f04bf8d59bcab127753b74d8cdd1d03e6a3a'
AND (
token = 'E0vEbec0BZDqq9btt2KD8cp0lKezYsWoxWv3f1VhzIc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)