UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0Q1DjSX4t9VURSr8PCkH7K+nzUEb7BSzk78fKPOfziw=' 
WHERE 
  key_id = 'abaa4f913479e3706d832de8c90ff92cc1eff4419a07ef8a37355729c1753555' 
  AND (
    token = '0Q1DjSX4t9VURSr8PCkH7K+nzUEb7BSzk78fKPOfziw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021