UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'BXKH3VjV+r+T16d5X+acnkGB82k2QB/N1OTQnzJcfaw=' 
WHERE 
  key_id = 'cb9001dc955161342127bf0d00010ae2b97118b1e1413ab9c9c6d8e69fc4bca1' 
  AND (
    token = 'BXKH3VjV+r+T16d5X+acnkGB82k2QB/N1OTQnzJcfaw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036