UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'CdyxX2/oN6XyECoVaQXX4o+Z9pXn436iOdrB/8NxWUM=' 
WHERE 
  key_id = '59a66f539b02319803db79ae9f6da852eb6c15851ca074d662714ba32c9582c6' 
  AND (
    token = 'CdyxX2/oN6XyECoVaQXX4o+Z9pXn436iOdrB/8NxWUM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038