UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ERsOJQYYWGhF0IWjfZeC5rTROgU6V9vAkDuP3Xjm3/o=' 
WHERE 
  key_id = '54756b1a661fd6a10d4b0cdd20a09de04488e0e1f33faa12f6e7cd7a25b3dd7f' 
  AND (
    token = 'ERsOJQYYWGhF0IWjfZeC5rTROgU6V9vAkDuP3Xjm3/o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045