UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HFnjwT/2NyDEDZN37stlrm6sq/JZCrk9wXeqqqy2w2Q='
WHERE
key_id = 'b47d0594f66a369c631b9f2a1b1913c3e51450fd17444db210da8b60fec2e2c1'
AND (
token = 'HFnjwT/2NyDEDZN37stlrm6sq/JZCrk9wXeqqqy2w2Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)