UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HoIhH5LGoNoSkfkG7dyRIaN9lsdugTL1GEX7Gd29sx4='
WHERE
key_id = '60a775304fd817fa150f31dfbea3114d093b59a752089f7e5041e19e1c9a5891'
AND (
token = 'HoIhH5LGoNoSkfkG7dyRIaN9lsdugTL1GEX7Gd29sx4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)