UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EyNXFpZJRG/1YW6NYWLE1JNYSrT60BGh97C9kgiYlVg='
WHERE
key_id = 'b28cafd539925b4efcb83cbfc9ff37d9f2f3ceb419c07368556a2b2c9275d718'
AND (
token = 'EyNXFpZJRG/1YW6NYWLE1JNYSrT60BGh97C9kgiYlVg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)