UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vcwfKWmtBZ0mncz3RVQTDVX2gTct9Bi1S89A2CzAotg='
WHERE
key_id = '7851dbc11f440c514aef536c29bbc5bba38887ddf0f7e070c27119495d34f716'
AND (
token = 'vcwfKWmtBZ0mncz3RVQTDVX2gTct9Bi1S89A2CzAotg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)