UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'BUdUjsip5aeiU8vZNx+r9AXfyPmnuhhXbgm0kS8v9iM=' 
WHERE 
  key_id = '728a3bf9fda8a7aa2ed2c59319691493154ff222dbd6f2bd51a55e7b44e1f674' 
  AND (
    token = 'BUdUjsip5aeiU8vZNx+r9AXfyPmnuhhXbgm0kS8v9iM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034