UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'A/fiXOviQ3kbuP5aKmj7k/Ffju0/ONhWFICKmx9tWfk='
WHERE
key_id = '6b7cbae3f5581fcea31a40a7d14e33cd9fdfb595d3aaad2b0fc64c0e792b5d45'
AND (
token = 'A/fiXOviQ3kbuP5aKmj7k/Ffju0/ONhWFICKmx9tWfk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)