UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rZnuiN+RnvOEP9x/9pyIRuwlnPjbUQXII6nqYWSgoKg=' 
WHERE 
  key_id = '484fe4c7dfd91d6603dfd69d398280e068ebd8c2c58a4740a589304b718920ab' 
  AND (
    token = 'rZnuiN+RnvOEP9x/9pyIRuwlnPjbUQXII6nqYWSgoKg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030