UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xISeNt6SwhYIWieH84S1GzogVY3G0EjP6BbKJTm/hew=' 
WHERE 
  key_id = 'c1e91153c9348d9bd3eb99a6876d3b30ee5d368ec9fdff843d9f3885f7ba0b2f' 
  AND (
    token = 'xISeNt6SwhYIWieH84S1GzogVY3G0EjP6BbKJTm/hew=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031