UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CXKjL8evtFbTmELtTh5h2ah/gUI99b2BIDYlOOV9f2A='
WHERE
key_id = '52a9b58c14ec4c8f9245e66264fa1433aea2c72684e556d72a851dda62f15cd9'
AND (
token = 'CXKjL8evtFbTmELtTh5h2ah/gUI99b2BIDYlOOV9f2A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)