UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vmcNbUHiR6AHi9WM1mIc5/o244DrIxSOsCaDFIrfv7k='
WHERE
key_id = 'cc7641b8ce4dbf93cf348f26230ee4f062ba31f76a43e8dcb9fa08cddbf759f5'
AND (
token = 'vmcNbUHiR6AHi9WM1mIc5/o244DrIxSOsCaDFIrfv7k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)