UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lhVm8iDn+MbJSj15ddZJNPbhLnDLVZ2OGTjxEpOrigA='
WHERE
key_id = 'b3f720356f9c6afc268f454ce7e8e6928834da1e08f3c9dac6b9e7cbe2f32dca'
AND (
token = 'lhVm8iDn+MbJSj15ddZJNPbhLnDLVZ2OGTjxEpOrigA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)