UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hJHhLUzEVNlD94NVYs6O8nQctTe2b5D2DNo9zd34ffA='
WHERE
key_id = '071ac5eb85a1f41770c764c98ecd412bc798b857ef9101a8355ad8ad031cdc15'
AND (
token = 'hJHhLUzEVNlD94NVYs6O8nQctTe2b5D2DNo9zd34ffA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)