UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'CRQs7YBu4BioHQBC5E6g0sL1jy2qwe3lPo21AmW5d/0=' 
WHERE 
  key_id = '4c3f163387d9f51347cb98ba031538e750272bac846e7e08e5a24678b6e5e18e' 
  AND (
    token = 'CRQs7YBu4BioHQBC5E6g0sL1jy2qwe3lPo21AmW5d/0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027