UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rfT+PpmPkQsgPi8huPVPcRnEFWMd/36aJh0Mmkymi30='
WHERE
key_id = 'f17fbdde6dc526a211385552cdbada0141042241668c0d92e2aa3d02bdfe841c'
AND (
token = 'rfT+PpmPkQsgPi8huPVPcRnEFWMd/36aJh0Mmkymi30='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)