UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'BsEMrAlwDIrzBZ8tE/4bDvwIDqYcP2ZMlEIJ7OU15AA=' 
WHERE 
  key_id = '6a02498aca4bfc2cd7235bf991f56dae9c96d96d76d6e78cadbb5e4e15d0ec57' 
  AND (
    token = 'BsEMrAlwDIrzBZ8tE/4bDvwIDqYcP2ZMlEIJ7OU15AA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016