UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'piqWn6ksKOTa7Fc6SLZ/ECLleC/aUXmCylggrsbnmG0='
WHERE
key_id = '06fc8d9e314ddc0792b66fa986d1dbcfb654d5b7e312cb7317f716fc12163451'
AND (
token = 'piqWn6ksKOTa7Fc6SLZ/ECLleC/aUXmCylggrsbnmG0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)