UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'W5RFEKLJuG93rHAXyyT4Qq6I+F1XQByiCamoI334EB4='
WHERE
key_id = '834a3aff6fc870214e09d3851427b0c4c2d56e9b3904143979bda0b483186aca'
AND (
token = 'W5RFEKLJuG93rHAXyyT4Qq6I+F1XQByiCamoI334EB4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)