UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'c1VQCrl4noACCcdAQHL7c9tilwDKeROCT9Fh/R/uoLU='
WHERE
key_id = '9f948eedc4b17e5dd8812fb4161b442b47641a83b3d12243162bf2dbd2786198'
AND (
token = 'c1VQCrl4noACCcdAQHL7c9tilwDKeROCT9Fh/R/uoLU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)