UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'i4O5EIj2kI3DvjhkUZ18B1aIjABKpbUmoh9d6pYJHpg=' 
WHERE 
  key_id = '2a2a53ee39f3325aa34d892f5f687d62ed382d37283ab2fd990ea08e5dfa2e54' 
  AND (
    token = 'i4O5EIj2kI3DvjhkUZ18B1aIjABKpbUmoh9d6pYJHpg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041