UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1VLcOSKaOJ+919ybNkJYDNGNB7sThllG81l/Ogtanjo='
WHERE
key_id = 'f2f68acb039e0c4a75608c182af1935b87bbf96d20b5aac1511c703f79720637'
AND (
token = '1VLcOSKaOJ+919ybNkJYDNGNB7sThllG81l/Ogtanjo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)