UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'IL+peG6HsJNyz0+H3CcwBpFKIBLZhS2bgXZ/3tZpKg4=' 
WHERE 
  key_id = 'd3dc6213bc838649a24ba47899bc24838e87dca17fbd66c13071d73004d547df' 
  AND (
    token = 'IL+peG6HsJNyz0+H3CcwBpFKIBLZhS2bgXZ/3tZpKg4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033